\(\int \frac {1+a x}{x^2 \sqrt {a x} \sqrt {1-a x}} \, dx\) [27]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [C] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 26, antiderivative size = 45 \[ \int \frac {1+a x}{x^2 \sqrt {a x} \sqrt {1-a x}} \, dx=-\frac {2 a \sqrt {1-a x}}{3 (a x)^{3/2}}-\frac {10 a \sqrt {1-a x}}{3 \sqrt {a x}} \]

[Out]

-2/3*a*(-a*x+1)^(1/2)/(a*x)^(3/2)-10/3*a*(-a*x+1)^(1/2)/(a*x)^(1/2)

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 45, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.115, Rules used = {16, 79, 37} \[ \int \frac {1+a x}{x^2 \sqrt {a x} \sqrt {1-a x}} \, dx=-\frac {10 a \sqrt {1-a x}}{3 \sqrt {a x}}-\frac {2 a \sqrt {1-a x}}{3 (a x)^{3/2}} \]

[In]

Int[(1 + a*x)/(x^2*Sqrt[a*x]*Sqrt[1 - a*x]),x]

[Out]

(-2*a*Sqrt[1 - a*x])/(3*(a*x)^(3/2)) - (10*a*Sqrt[1 - a*x])/(3*Sqrt[a*x])

Rule 16

Int[(u_.)*(v_)^(m_.)*((b_)*(v_))^(n_), x_Symbol] :> Dist[1/b^m, Int[u*(b*v)^(m + n), x], x] /; FreeQ[{b, n}, x
] && IntegerQ[m]

Rule 37

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[(a + b*x)^(m + 1)*((c + d*x)^(n +
1)/((b*c - a*d)*(m + 1))), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[b*c - a*d, 0] && EqQ[m + n + 2, 0] && NeQ
[m, -1]

Rule 79

Int[((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Simp[(-(b*e - a*f
))*(c + d*x)^(n + 1)*((e + f*x)^(p + 1)/(f*(p + 1)*(c*f - d*e))), x] - Dist[(a*d*f*(n + p + 2) - b*(d*e*(n + 1
) + c*f*(p + 1)))/(f*(p + 1)*(c*f - d*e)), Int[(c + d*x)^n*(e + f*x)^(p + 1), x], x] /; FreeQ[{a, b, c, d, e,
f, n}, x] && LtQ[p, -1] && ( !LtQ[n, -1] || IntegerQ[p] ||  !(IntegerQ[n] ||  !(EqQ[e, 0] ||  !(EqQ[c, 0] || L
tQ[p, n]))))

Rubi steps \begin{align*} \text {integral}& = a^2 \int \frac {1+a x}{(a x)^{5/2} \sqrt {1-a x}} \, dx \\ & = -\frac {2 a \sqrt {1-a x}}{3 (a x)^{3/2}}+\frac {1}{3} \left (5 a^2\right ) \int \frac {1}{(a x)^{3/2} \sqrt {1-a x}} \, dx \\ & = -\frac {2 a \sqrt {1-a x}}{3 (a x)^{3/2}}-\frac {10 a \sqrt {1-a x}}{3 \sqrt {a x}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.07 (sec) , antiderivative size = 29, normalized size of antiderivative = 0.64 \[ \int \frac {1+a x}{x^2 \sqrt {a x} \sqrt {1-a x}} \, dx=-\frac {2 \sqrt {-a x (-1+a x)} (1+5 a x)}{3 a x^2} \]

[In]

Integrate[(1 + a*x)/(x^2*Sqrt[a*x]*Sqrt[1 - a*x]),x]

[Out]

(-2*Sqrt[-(a*x*(-1 + a*x))]*(1 + 5*a*x))/(3*a*x^2)

Maple [A] (verified)

Time = 1.52 (sec) , antiderivative size = 25, normalized size of antiderivative = 0.56

method result size
gosper \(-\frac {2 \left (5 a x +1\right ) \sqrt {-a x +1}}{3 x \sqrt {a x}}\) \(25\)
default \(-\frac {2 \sqrt {-a x +1}\, \operatorname {csgn}\left (a \right )^{2} \left (5 a x +1\right )}{3 x \sqrt {a x}}\) \(29\)
meijerg \(-\frac {2 a \sqrt {-a x +1}}{\sqrt {a x}}-\frac {2 \left (2 a x +1\right ) \sqrt {-a x +1}}{3 \sqrt {a x}\, x}\) \(42\)
risch \(\frac {2 \sqrt {a x \left (-a x +1\right )}\, \left (5 a^{2} x^{2}-4 a x -1\right )}{3 \sqrt {a x}\, \sqrt {-a x +1}\, x \sqrt {-x \left (a x -1\right ) a}}\) \(55\)

[In]

int((a*x+1)/x^2/(a*x)^(1/2)/(-a*x+1)^(1/2),x,method=_RETURNVERBOSE)

[Out]

-2/3/x/(a*x)^(1/2)*(5*a*x+1)*(-a*x+1)^(1/2)

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 27, normalized size of antiderivative = 0.60 \[ \int \frac {1+a x}{x^2 \sqrt {a x} \sqrt {1-a x}} \, dx=-\frac {2 \, {\left (5 \, a x + 1\right )} \sqrt {a x} \sqrt {-a x + 1}}{3 \, a x^{2}} \]

[In]

integrate((a*x+1)/x^2/(a*x)^(1/2)/(-a*x+1)^(1/2),x, algorithm="fricas")

[Out]

-2/3*(5*a*x + 1)*sqrt(a*x)*sqrt(-a*x + 1)/(a*x^2)

Sympy [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 2.66 (sec) , antiderivative size = 107, normalized size of antiderivative = 2.38 \[ \int \frac {1+a x}{x^2 \sqrt {a x} \sqrt {1-a x}} \, dx=a \left (\begin {cases} - 2 \sqrt {-1 + \frac {1}{a x}} & \text {for}\: \frac {1}{\left |{a x}\right |} > 1 \\- 2 i \sqrt {1 - \frac {1}{a x}} & \text {otherwise} \end {cases}\right ) + \begin {cases} - \frac {4 a \sqrt {-1 + \frac {1}{a x}}}{3} - \frac {2 \sqrt {-1 + \frac {1}{a x}}}{3 x} & \text {for}\: \frac {1}{\left |{a x}\right |} > 1 \\- \frac {4 i a \sqrt {1 - \frac {1}{a x}}}{3} - \frac {2 i \sqrt {1 - \frac {1}{a x}}}{3 x} & \text {otherwise} \end {cases} \]

[In]

integrate((a*x+1)/x**2/(a*x)**(1/2)/(-a*x+1)**(1/2),x)

[Out]

a*Piecewise((-2*sqrt(-1 + 1/(a*x)), 1/Abs(a*x) > 1), (-2*I*sqrt(1 - 1/(a*x)), True)) + Piecewise((-4*a*sqrt(-1
 + 1/(a*x))/3 - 2*sqrt(-1 + 1/(a*x))/(3*x), 1/Abs(a*x) > 1), (-4*I*a*sqrt(1 - 1/(a*x))/3 - 2*I*sqrt(1 - 1/(a*x
))/(3*x), True))

Maxima [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 42, normalized size of antiderivative = 0.93 \[ \int \frac {1+a x}{x^2 \sqrt {a x} \sqrt {1-a x}} \, dx=-\frac {10 \, \sqrt {-a^{2} x^{2} + a x}}{3 \, x} - \frac {2 \, \sqrt {-a^{2} x^{2} + a x}}{3 \, a x^{2}} \]

[In]

integrate((a*x+1)/x^2/(a*x)^(1/2)/(-a*x+1)^(1/2),x, algorithm="maxima")

[Out]

-10/3*sqrt(-a^2*x^2 + a*x)/x - 2/3*sqrt(-a^2*x^2 + a*x)/(a*x^2)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 88 vs. \(2 (33) = 66\).

Time = 0.29 (sec) , antiderivative size = 88, normalized size of antiderivative = 1.96 \[ \int \frac {1+a x}{x^2 \sqrt {a x} \sqrt {1-a x}} \, dx=-\frac {\frac {a^{2} {\left (\sqrt {-a x + 1} - 1\right )}^{3}}{\left (a x\right )^{\frac {3}{2}}} + \frac {21 \, a^{2} {\left (\sqrt {-a x + 1} - 1\right )}}{\sqrt {a x}} - \frac {{\left (a^{2} + \frac {21 \, a {\left (\sqrt {-a x + 1} - 1\right )}^{2}}{x}\right )} \left (a x\right )^{\frac {3}{2}}}{{\left (\sqrt {-a x + 1} - 1\right )}^{3}}}{12 \, a} \]

[In]

integrate((a*x+1)/x^2/(a*x)^(1/2)/(-a*x+1)^(1/2),x, algorithm="giac")

[Out]

-1/12*(a^2*(sqrt(-a*x + 1) - 1)^3/(a*x)^(3/2) + 21*a^2*(sqrt(-a*x + 1) - 1)/sqrt(a*x) - (a^2 + 21*a*(sqrt(-a*x
 + 1) - 1)^2/x)*(a*x)^(3/2)/(sqrt(-a*x + 1) - 1)^3)/a

Mupad [B] (verification not implemented)

Time = 3.38 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.53 \[ \int \frac {1+a x}{x^2 \sqrt {a x} \sqrt {1-a x}} \, dx=-\frac {\sqrt {1-a\,x}\,\left (\frac {10\,a\,x}{3}+\frac {2}{3}\right )}{x\,\sqrt {a\,x}} \]

[In]

int((a*x + 1)/(x^2*(a*x)^(1/2)*(1 - a*x)^(1/2)),x)

[Out]

-((1 - a*x)^(1/2)*((10*a*x)/3 + 2/3))/(x*(a*x)^(1/2))